package com.zt.jbpm.handler;

import org.jbpm.graph.exe.ExecutionContext;
import org.jbpm.taskmgmt.def.AssignmentHandler;
import org.jbpm.taskmgmt.exe.Assignable;
import org.springframework.stereotype.Component;

@Component("grantAssignmentHandler")
public class GrantAssignmentHandler implements AssignmentHandler {

	private static final long serialVersionUID = 1L;

	public void assign(Assignable assignable, ExecutionContext executionContext) throws Exception {
		String name = executionContext.getTaskInstance().getName();
		if("部门经理审批".equals(name)){
			//assignable.setPooledActors(new String[]{"2"});
			assignable.setActorId("2");
		}else if("老板审批".equals(name)){
			//assignable.setPooledActors(new String[]{"1"});
			assignable.setActorId("1");
		}
	}

}
